package com.itheima;

import java.util.Scanner;

public class Test6 {
    //需求：输入一串数字，将每位数字加5，在对10求余，最后将所有数字反转，得到一串新数字

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一串数字：");
        String str = sc.next();
        String newStr = "";
        String reverseStr="";
        String[]arr=str.split("");

        for (int i = 0; i < arr.length; i++) {
            int intNum=(Integer.parseInt(arr[i])+5)%10;
            newStr+=intNum;

        }

        reverseStr=reverse1(newStr);
        System.out.println(reverseStr);
    }
    // StringBuffer
    public static String reverse1(String str) {
        return new StringBuilder(str).reverse().toString();
    }
}
